<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" th:href="@{/assets/css/colorbox.css}" />
<head th:include="fragments/head::header" />
<style>
    .error {
        color: #F00
    }
</style>
<body>
<div th:include="fragments/top::top"></div>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <div th:include="fragments/left::left" class="sidebar" id="sidebar"></div>
        <div class="main-content">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i> <a href="/main">首页</a></li>
                    <li>运营管理</li>
                    <li>作废学生信息列表</li>
                </ul>
            </div>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="row">
                            <div class="col-xs-12">
                                <h3 class="header smaller lighter blue">作废学生信息列表</h3>
                                <div class="table-header">
                                    <form class="form-inline">
                                        <div class="form-group">
                                            <label>学号：</label>
                                            <input type="text" id="input_sNo" class="form-control input-sm" placeholder="" style="width:100px;"/>
                                            <label for="input_sName">姓名/拼音：</label>
                                            <input type="text" id="input_sName" class="form-control input-sm" placeholder="" style="width:60px;" />
                                        </div>
                                        <button type="button" id="query" class="btn btn-success ">查询</button>
                                        <button type="reset" class="btn btn-warning">清空</button>
                                    </form>
                                </div>
                                <div class="table-responsive">
                                    <div id="alert" class="alert alert-success" style="display: none;" role="alert">
                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                            <span aria-hidden="true">&times;</span>
                                        </button>
                                        <span id="alertText"></span>
                                    </div>
                                    <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                                        <thead>
                                        <tr>
                                            <th>学号</th>
                                            <th>姓名</th>
                                            <th>拼音</th>
                                            <th>出生日期</th>
                                            <th>服务进程</th>
                                            <th>国家</th>
                                            <th>合同名称</th>
                                            <th>咨询顾问</th>
                                            <th>文签顾问</th>
                                            <th>备注</th>
                                            <th class="hidden-480">操作</th>
                                        </tr>
                                        </thead>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div th:include="fragments/bottom::bottom"></div>
    </div>
    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="icon-double-angle-up icon-only bigger-110"></i>
    </a>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content"></div>
    </div>
</div>
<div th:include="fragments/js::js"></div>
<script th:src="@{/assets/js/jquery.validate.min.js}"></script>
<script th:src="@{/assets/js/jquery.validate.zh-CN.js}"></script>
<!-- page specific plugin scripts -->
<script th:src="@{/assets/js/jquery.dataTables.min.js}"></script>
<script th:src="@{/assets/js/jquery.dataTables.bootstrap.js}"></script>
<script th:src="@{/assets/js/temp.js}" charset="UTF-8"></script>
<!--图片查看器-->
<script th:src="@{/assets/js/jquery.colorbox-min.js}"></script>
<script th:src="@{/layer/layer.js}"></script>
<script th:src="@{/assets/js/date-time/moment.min.js}"></script>
<script type="text/javascript">
    <!--
    var oTable1;
    jQuery(function($) {
        oTable1 = $('#sample-table-2').dataTable({
//            "sScrollY": "380px",
            "bFilter" : false,//是否使用搜索
            "bProcessing" : true,
            "bDeferRender" : true,//
            "sPaginationType" : "bs_normal",//分页样式
            "bRetrieve" : true,//是否调用后台
            "bServerSide" : true,//是否以后台分页
            "bAutoWidth": true,
            "sAjaxSource" : "/operation/query",//请求路径
            "fnServerData" : function(sSource, aoData, fnCallback) {
                var sNo = $("#input_sNo").val() == ""?null:$("#input_sNo").val();
                var sName = $("#input_sName").val() == ""?null:$("#input_sName").val();
                if(sNo != null)
                    aoData.push({"name":"studentNo","value":sNo });
                if(sName != null)
                    aoData.push({"name":"studentName","value":sName });
                $.ajax({
                    "dataType" : 'json',
                    "type" : "GET",
                    "url" : sSource,
                    "data" : aoData,
                    "success" : fnCallback
                });
            },
            "aaSorting" : [ [ 1, "desc" ] ],
            "aoColumns" : [
                {"sClass": "center", "bSortable": false, "mData": "studentNo"},
                {"sClass": "center", "bSortable": false, "mData": "studentName"},
                {"sClass": "center", "bSortable": false, "mData": "pinyin"},
                {
                    "sClass": "center", "bSortable": false, "mData": "birthday",
                    "mRender": function (data, type, full, meta) {
                        return moment(data).format("YYYY-MM-DD HH:mm:ss");
                    }
                },
                {
                    "sClass": "center", "bSortable": false, "mData":
                    function (data) {
                        if (data.status == 10) {
                            return "未上传文书材料";
                        } else if (data.status == 20) {
                            return "未递交申请材料";
                        } else if (data.status == 30) {
                            return "未收到申请结果";
                        } else if (data.status == 40) {
                            return "未确认录取院校";
                        } else if (data.status == 50) {
                            return "未进行签证辅导";
                        } else if (data.status == 60) {
                            return "未递交签证申请";
                        } else if (data.status == 70) {
                            return "未收到签证结果";
                        } else if (data.status == 80) {
                            return "未填写获签信息";
                        } else if (data.status == 90) {
                            return "已结案";
                        } else if (data.status == 100) {
                            return "已退费";
                        } else if (data.status == 85) {
                            return "待结案";
                        } else {
                            return "";
                        }

                    }
                },
                {
                    "sClass": "center", "bSortable": false, "mData":
                    function (data) {
                        if (data.nationName == "美高") return "美国";
                        if (data.nationName == "美普") return "美国";
                        else return data.nationName;
                    }
                },
                {"sClass": "center", "bSortable": false, "mData": "contractNo"},

                {"sClass": "center", "bSortable": false, "mData": "salesConsultant"},
                {"sClass": "center", "bSortable": false, "mData": "copyOperator"},
                {"sClass": "center", "bSortable": false, "mData": "remark"},
                {
                    "sClass": "center", "bSortable": false, "mData": function (data) {
                    var styleDiv = '<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">';
                    var visitOperation = '<a class="blue"  href="javascript:void(0);" onclick="enableData(\'' + data.studentNo + '\')">取消作废</a>';
                    return styleDiv + visitOperation + '</div>';
                }
                }
            ],
            "oLanguage" : {
                "sLengthMenu" : "每页 _MENU_条 ",
                "sZeroRecords" : "对不起，查询不到任何相关数据",
                "sInfo" : "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录 ",
                "sInfoEmpty" : "显示 0 到 0 条，共 0 条记录",
                "sInfoFiltered" : "数据表中共为 _MAX_ 条记录)",
                "sProcessing" : "正在加载中...",
                "sSearch" : "搜索",
                "sUrl" : "", //多语言配置文件，可将oLanguage的设置放在一个txt文件中，例：Javascript/datatable/dtCH.txt
                "oPaginate" : {
                    "sFirst" : "第一页",
                    "sPrevious" : " 上一页 ",
                    "sNext" : " 下一页 ",
                    "sLast" : " 最后一页 "
                }
            }
            //多语言配置
        });
        $("#query").click(function() {
            oTable1.fnDraw();
        })
    })

    function enableData(studentNo) {
        layer.confirm('您确定取消作废吗？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.post("/operation/enableStudent",{"studentNo":studentNo},function(data, status){
                if(data){
                    window.location.reload();
                }
            });
        }, function(){
            parent.layer.close();
        });
    }
    -->
</script>
</body>
</html>